package com.web.support;

import java.util.List;

public class Pagination {
	
	private int pageSize = 3;
	private int currentPage = 1;
	private int totalPage;
	private int totalCount;
	
	private List<Object> data;
	
	public int getTotalPage() {
		return totalPage;
	}
	public void setTotalPage(int totalPage) {
		this.totalPage = totalPage;
	}
	public int getPageSize() {
		return pageSize;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public int getCurrentPage() {
		return currentPage;
	}
	public void setCurrentPage(int currentPage) {
		this.currentPage = currentPage;
	}
	public List<Object> getData() {
		return data;
	}
	public void setData(List<Object> data) {
		this.data = data;
	}
	public int getTotalCount() {
		return totalCount;
	}
	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
		totalPage = this.totalCount/pageSize;
		if(this.totalCount%pageSize != 0){
			totalPage++;
		}
	}
	public int getNextPage() {
		return currentPage + 1 > totalPage ? totalPage : currentPage + 1;
	}
	public int getPrePage() {
		return currentPage - 1 < 1? 1 : currentPage - 1;
	}
	
	
}
